import { request } from '@/utils/request'

// 查询延期申请列表
export function listExtension(query) {
  return request({
    url: '/workorder/woExtension/list',
    method: 'get',
    params: query
  })
}

// 查询延期申请列表
export function listExtensionAll(query) {
  return request({
    url: '/workorder/woExtension/list/all',
    method: 'get',
    params: query
  })
}

// 查询延期申请详细
export function getExtension(id) {
  return request({
    url: '/workorder/woExtension/' + id,
    method: 'get'
  })
}

// 新增延期申请
export function addExtension(data) {
  return request({
    url: '/workorder/woExtension',
    method: 'post',
    data: data
  },{
    successMsg:"操作成功！"
  })
}

// 修改延期申请
export function updateExtension(data) {
  return request({
    url: '/workorder/woExtension',
    method: 'put',
    data: data
  })
}

// 删除延期申请
export function delExtension(id) {
  return request({
    url: '/workorder/woExtension/' + id,
    method: 'delete'
  })
}

// 初始化延期申请单
export function getInitExtension() {
  return request({
    url: '/workorder/woExtension/getInitExtension',
    method: 'get'
  })
}

// 审核流程
approveExtension
export function approveExtension(data) {
  return request({
    url: '/workorder/woExtension/approve',
    method: 'post',
    data: data
  },{
    successMsg:"操作成功！"
  })
}